﻿<ResourceDictionary xmlns:src="clr-namespace:Silverlight.ControlToolkit.Windows;assembly=Silverlight.ControlToolkit" xmlns:inp="clr-namespace:Silverlight.ControlToolkit.InputControls;assembly=Silverlight.ControlToolkit" xmlns:srcv="clr-namespace:Silverlight.ControlToolkit.Validator;assembly=Silverlight.ControlToolkit" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"  xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/client/2007">

    <Style TargetType="src:BusyBox">
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush>
                    <GradientStop Color="Beige"/>
                    <GradientStop Color="SkyBlue" Offset="0.5"/>
                    <GradientStop Color="LightGreen" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" Value="Navy"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Foreground" Value="Navy"/>
        <Setter Property="FontSize" Value="14"/>


        <!--<Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="src:BusyBox">
                    <Grid x:Name="RootElement" Opacity="0.7">
                        <Border x:Name="MessageBorderElement" CornerRadius="20" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"  Width="Auto" Height="Auto">
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
                                <TextBlock x:Name="MessageTextElement" Text="Retreiving data " HorizontalAlignment="Center"  TextWrapping="Wrap"  FontSize="{TemplateBinding FontSize}" Foreground="{TemplateBinding Foreground}" Margin="15,15,0,15"></TextBlock>
                                <Canvas x:Name="ParentCanvasElement" Margin="5,0,15,0" Height="30" Width="30" VerticalAlignment="Center" HorizontalAlignment="Center">
                                    <Canvas Height="30" Width="30" x:Name="ChildCanvasElement" RenderTransformOrigin=".5,.5" VerticalAlignment="Center" HorizontalAlignment="Center">
                                        <Canvas.Resources>
                                            <Storyboard x:Name="SpinningAnimationStoryboard">
                                                <DoubleAnimation From="0" To="360" RepeatBehavior="Forever" SpeedRatio="1.00" 
                                                Storyboard.TargetName="spin" Storyboard.TargetProperty="(FrameworkElement.Angle)"/>
                                            </Storyboard>
                                        </Canvas.Resources>
                                        <Canvas.RenderTransform>
                                            <RotateTransform x:Name="spin" Angle="0"/>
                                        </Canvas.RenderTransform>

                                    </Canvas>
                                </Canvas>

                            </StackPanel>
                        </Border>

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>-->

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="src:BusyBox">
                    <Grid x:Name="RootElement" Opacity="0.7">
                        <Grid.Resources>
                            <Style x:Key="ProgressBarWinPanel" TargetType="src:WindowPanel">
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="src:WindowPanel">
                                            <Grid x:Name="RootContainerElement">
                                                <Grid x:Name="RootElement">
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto" />
                                                    </Grid.RowDefinitions>
                                                    <Border x:Name="ContentHolderElement" Visibility="Collapsed"  Grid.Row="1" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="20" Background="{TemplateBinding Background}"  Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" MaxWidth="{TemplateBinding MaxWidth}" MaxHeight="{TemplateBinding MaxHeight}">
                                                        <StackPanel>
                                                            <Button Grid.Column="5" x:Name="CloseElement"  /> <!--This is required to trigger the Load event so that the element could be centered-->
                                                            <ContentPresenter x:Name="ContentElement" Content="{TemplateBinding Content}"  MaxWidth="{TemplateBinding MaxWidth}" MaxHeight="{TemplateBinding MaxHeight}" />
                                                        </StackPanel>
                                                    </Border>
                                                </Grid>
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>

                            </Style>
                        </Grid.Resources>
                        <src:WindowPanel IsExpandable="False" IsExpandedOnLoad="True" x:Name="MessageBorderElement" ShowCloseButton="False" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"  Width="Auto" Height="Auto" Style="{StaticResource ProgressBarWinPanel}" >
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
                                <TextBlock x:Name="MessageTextElement" Text="Retreiving data " HorizontalAlignment="Center"  TextWrapping="Wrap"  FontSize="{TemplateBinding FontSize}" Foreground="{TemplateBinding Foreground}" Margin="15,15,0,15"></TextBlock>
                                <Canvas x:Name="ParentCanvasElement" Margin="5,0,15,0" Height="30" Width="30" VerticalAlignment="Center" HorizontalAlignment="Center">
                                    <Canvas Height="30" Width="30" x:Name="ChildCanvasElement" RenderTransformOrigin=".5,.5" VerticalAlignment="Center" HorizontalAlignment="Center">
                                        <Canvas.Resources>
                                            <Storyboard x:Name="SpinningAnimationStoryboard">
                                                <DoubleAnimation From="0" To="360" RepeatBehavior="Forever" SpeedRatio="1.00" 
                                                Storyboard.TargetName="spin" Storyboard.TargetProperty="(FrameworkElement.Angle)"/>
                                            </Storyboard>
                                        </Canvas.Resources>
                                        <Canvas.RenderTransform>
                                            <RotateTransform x:Name="spin" Angle="0"/>
                                        </Canvas.RenderTransform>

                                    </Canvas>
                                </Canvas>
                            </StackPanel>
                        </src:WindowPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>


    </Style>

    <Style x:Key="RoundCloseButton" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Grid.Resources>
                            <!-- Hover -->
                            <RadialGradientBrush x:Key="hoverBack" >
                                <GradientStop Color="#FFE69B8F"/>
                                <GradientStop Color="#FFCB6432" Offset="1"/>
                                <GradientStop Color="#FFD26554" Offset="0.512"/>
                            </RadialGradientBrush>
                            <RadialGradientBrush x:Key="hoverBorder" >
                                <GradientStop Color="Black"/>
                                <!--<GradientStop Color="#FFFCFCFC"/>
                                <GradientStop Color="#FFF1C27C" Offset="1"/>
                                <GradientStop Color="#FFE8B6AD" Offset="0.512"/>
                                <GradientStop Color="#FFD6978E" Offset="0.518"/>-->
                            </RadialGradientBrush>

                            <!-- Pressed -->
                            <RadialGradientBrush x:Key="pressedBack" >
                                <GradientStop Color="#FFAE907B"/>
                                <GradientStop Color="#FF55390F" Offset="1"/>
                                <GradientStop Color="#FF8A5840" Offset="0.512"/>
                            </RadialGradientBrush>
                            <RadialGradientBrush x:Key="pressedBorder" >
                                <GradientStop Color="Black"/>
                                <!--<GradientStop Color="#FFFCFCFC"/>
                                <GradientStop Color="#FFF1C27C" Offset="1"/>
                                <GradientStop Color="#FFE8B6AD" Offset="0.512"/>
                                <GradientStop Color="#FFD6978E" Offset="0.518"/>-->
                            </RadialGradientBrush>

                            <SolidColorBrush x:Key="CloseBorderBrush" Color="#FF542C24" />
                            <RadialGradientBrush x:Key="CloseForeground">
                                <GradientStop Color="#FFE3B5AF"/>
                                <GradientStop Color="#FFC37F74" Offset="1"/>
                                <GradientStop Color="#FFCF8279" Offset="0.512"/>
                            </RadialGradientBrush>
                            <RadialGradientBrush x:Key="CloseBackground">
                                <GradientStop Color="#FFFCFCFC"/>
                                <GradientStop Color="#FFE3B8B0" Offset="1"/>
                                <GradientStop Color="#FFE0BFBD" Offset="0.512"/>
                                <GradientStop Color="#FFD4A7A3" Offset="0.518"/>
                            </RadialGradientBrush>
                        </Grid.Resources>

                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualState x:Name="Unfocused"/>
                                <vsm:VisualState x:Name="Focused"/>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPressedBorder" Storyboard.TargetProperty="Background" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource hoverBack}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPressedBorder" Storyboard.TargetProperty="BorderBrush" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource hoverBorder}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPressedRect" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPressedBorder" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPressedBorder" Storyboard.TargetProperty="Background" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource pressedBack}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPressedBorder" Storyboard.TargetProperty="BorderBrush" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource pressedBorder}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPressedRect" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPressedBorder" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled"/>
                                <vsm:VisualState x:Name="Normal"/>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>

                        <Border x:Name="Border" Margin="0" BorderThickness="1,1,1,1" Width="18" Height="18" CornerRadius="15,15,15,15"  BorderBrush="{StaticResource hoverBorder}" Background="{StaticResource hoverBack}"/>
                        <Border x:Name="HoverPressedBorder" Margin="0" BorderThickness="1,1,1,1" Width="18" Height="18" CornerRadius="15" BorderBrush="{StaticResource CloseBorderBrush}"  Visibility="Collapsed" d:IsHidden="True"/>

                        <Rectangle x:Name="HoverPressedRect" Height="18" Width="18" RadiusX="15" RadiusY="15" StrokeThickness="0"  Margin="0,1,0,2" Stroke="{StaticResource CloseBorderBrush}"  Visibility="Collapsed">
                            <Rectangle.Fill>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="0.861" ScaleY="1.097"/>
                                            <SkewTransform CenterX="0.5" CenterY="0.5"/>
                                            <RotateTransform CenterX="0.5" CenterY="0.5"/>
                                            <TranslateTransform Y="0.45"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FFF5E777"/>
                                    <GradientStop Color="#00FFFFFF" Offset="1"/>
                                </RadialGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>

                        <!--<ContentPresenter HorizontalAlignment="Center" Margin="1"/>-->
                        <Path Height="10" HorizontalAlignment="Center" VerticalAlignment="Center" Width="12" Fill="#E4FFFFFF" Stretch="Fill" Stroke="#FF454651" Data="M0.5,0.5 L4.5178828,0.5 L6.0620003,3.125 L7.4936447,0.5 L11.5,0.5 L11.5,1.5476431 L8.7425003,6.1201854 L11.5,10.359666 L11.5,11.5 L7.4941902,11.5 L6.0620003,8.8740005 L4.5172949,11.5 L0.5,11.5 L0.5,10.43379 L3.3059995,6.1201582 L0.5,1.4676378 L0.5,0.5 z"/>

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--<Style TargetType="src:MessageWindow">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="src:MessageWindow">
                    <Grid x:Name="RootElement">
                        <Grid.Resources>
                            <Style x:Key="MessageWindowButton" TargetType="Button">
                                <Setter Property="Width" Value="100"/>
                                <Setter Property="Height" Value="30"/>
                                <Setter Property="Margin" Value="10"/>
                            </Style>
                        </Grid.Resources>
                        <Border x:Name="MessageBorderElement" CornerRadius="30" BorderBrush="Black"  BorderThickness="2" Background="Cornsilk"  Width="Auto" Height="Auto">
                            <Grid>

                                <Grid.RowDefinitions>
                                    <RowDefinition Height="40"></RowDefinition>
                                    <RowDefinition Height="*"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Border x:Name="TitleBarElement" Grid.Row="0" CornerRadius="35" VerticalAlignment="Top" BorderBrush="DarkGray"  BorderThickness="1" Background="Navy"  Width="Auto" Height="40">
                                    <TextBlock x:Name="TitleTextElement" Text="" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="18" FontWeight="Bold"/>
                                </Border>

                                <StackPanel x:Name="StackHolder" Grid.Row="1" Width="Auto" Height="Auto">
                                    <Grid >
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"></ColumnDefinition>
                                            <ColumnDefinition Width="*"></ColumnDefinition>
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="*"></RowDefinition>
                                        </Grid.RowDefinitions>
                                        <Image Grid.Column="0"  x:Name="MessageIconErrorElement" Source="Images/error_button.png"  Stretch="None"  Visibility="Collapsed" />
                                        <Image Grid.Column="0"  x:Name="MessageIconInfoElement" Source="Images/Information.png"  Stretch="None"  Visibility="Collapsed" />
                                        <Image Grid.Column="0"  x:Name="MessageIconWarnElement" Source="Images/warning.png"  Stretch="None"  Visibility="Collapsed" />
                                        <Image Grid.Column="0"  x:Name="MessageIconQuestionElement" Source="Images/question.png"  Stretch="None"  Visibility="Collapsed" />
                                        <TextBlock Grid.Column="1"  x:Name="MessageTextElement" Text="Hello World" HorizontalAlignment="Center"  TextWrapping="Wrap"  FontSize="15" Margin="10"></TextBlock>
                                    </Grid>
                                    <StackPanel x:Name="ButtonHolderElement"  Margin="10" VerticalAlignment="Bottom" HorizontalAlignment="Center"  Orientation="Horizontal">
                                        <Button x:Name="OkButtonElement" Content="OK" Style="{StaticResource MessageWindowButton}"  />
                                        <Button x:Name="CancelButtonElement" Content="Cancel" Style="{StaticResource MessageWindowButton}" />
                                        <Button x:Name="YesButtonElement" Content="Yes" Style="{StaticResource MessageWindowButton}"  />
                                        <Button x:Name="NoButtonElement" Content="No" Style="{StaticResource MessageWindowButton}"  />
                                        <Button x:Name="AbortButtonElement" Content="Abort" Style="{StaticResource MessageWindowButton}"  />
                                        <Button x:Name="RetryButtonElement" Content="Retry" Style="{StaticResource MessageWindowButton}"  />
                                        <Button x:Name="IgnoreButtonElement" Content="Ignore" Style="{StaticResource MessageWindowButton}"  />
                                    </StackPanel>
                                </StackPanel>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>-->

    <Style TargetType="src:WindowPanel">
        <Setter Property="Background" Value="AliceBlue"/>
        <Setter Property="BorderBrush" Value="Navy"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="src:WindowPanel">
                    <Canvas x:Name="RootContainerElement">
                        <Grid x:Name="RootElement">

                            <Grid.Resources>
                                <Storyboard x:Name="ExpandAnimationStoryboard">
                                    <ColorAnimationUsingKeyFrames Storyboard.TargetName="pathFill" Storyboard.TargetProperty="(SolidColorBrush.Color)">
                                        <SplineColorKeyFrame KeyTime="00:00:00.1" Value="Black" />
                                    </ColorAnimationUsingKeyFrames>
                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="pathRotation" Storyboard.TargetProperty="(RotateTransform.Angle)">
                                        <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="-90" />
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>

                                <Storyboard x:Name="CollapseAnimationStoryboard">
                                    <ColorAnimationUsingKeyFrames Storyboard.TargetName="pathFill" Storyboard.TargetProperty="(SolidColorBrush.Color)">
                                        <SplineColorKeyFrame KeyTime="00:00:00.1" Value="Black" />
                                    </ColorAnimationUsingKeyFrames>
                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="pathRotation" Storyboard.TargetProperty="(RotateTransform.Angle)">
                                        <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="90" />
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>

                            </Grid.Resources>

                            <Grid.RowDefinitions>
                                <RowDefinition Height="25"/>
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>

                            <Border x:Name="HeaderElement" Grid.Row="0" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="5,5,0,0" Background="#FFCBD0E1">
                                <Grid >

                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Column="0" x:Name="HeaderTextElement" Margin="5,5,0,0" Text="Header" FontSize="12" FontFamily="Arial" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" TextWrapping="Wrap"/>

                                    <Path Grid.Column="2" x:Name="ExpanderElement" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,5,20,5" Height="8"   Width="8" Stretch="Fill" Data="M94.666667,7 L94.666667,20.666667 105.08269,14.416485 z"  RenderTransformOrigin="0.5,0.5">
                                        <Path.Fill>
                                            <SolidColorBrush x:Name="pathFill" Color="Black" />
                                        </Path.Fill>
                                        <Path.RenderTransform>
                                            <RotateTransform Angle="90" x:Name="pathRotation"/>
                                        </Path.RenderTransform>
                                    </Path>


                                    <Button Grid.Column="5" x:Name="CloseElement" Style="{StaticResource RoundCloseButton}" IsTabStop="False" Margin="0,2,2,2" />
                                </Grid>

                            </Border>

                            <Border x:Name="ContentHolderElement" Visibility="Collapsed"  Grid.Row="1" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0,0,5,5" Background="{TemplateBinding Background}"  Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" MaxWidth="{TemplateBinding MaxWidth}" MaxHeight="{TemplateBinding MaxHeight}">
                                <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" VerticalAlignment="Top" HorizontalAlignment="Left">
                                    <ContentPresenter x:Name="ContentElement" Content="{TemplateBinding Content}"  MaxWidth="{TemplateBinding MaxWidth}" MaxHeight="{TemplateBinding MaxHeight}" />
                                </ScrollViewer>
                            </Border>

                        </Grid>

                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style TargetType="src:MessageWindow">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="src:MessageWindow">
                    <Grid x:Name="RootElement">
                        <Grid.Resources>
                            <Style x:Key="MessageWindowButton" TargetType="Button">
                                <Setter Property="Width" Value="100"/>
                                <Setter Property="Height" Value="30"/>
                                <Setter Property="Margin" Value="10"/>
                            </Style>
                        </Grid.Resources>
                        <src:WindowPanel IsExpandable="False" IsExpandedOnLoad="True" x:Name="MessageBorderElement" BorderBrush="Black"  BorderThickness="2" Background="Cornsilk"  Width="Auto" Height="Auto" HeaderBackground="Navy" HeaderText="" HeaderFontSize="12" HeaderForeground="White" >
                            <StackPanel x:Name="StackHolder">
                                <Grid >
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"></ColumnDefinition>
                                        <ColumnDefinition Width="*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Image Grid.Column="0"  x:Name="MessageIconErrorElement" Source="Images/error_button.png"  Stretch="None"  Visibility="Collapsed" />
                                    <Image Grid.Column="0"  x:Name="MessageIconInfoElement" Source="Images/Information.png"  Stretch="None"  Visibility="Collapsed" />
                                    <Image Grid.Column="0"  x:Name="MessageIconWarnElement" Source="Images/warning.png"  Stretch="None"  Visibility="Collapsed" />
                                    <Image Grid.Column="0"  x:Name="MessageIconQuestionElement" Source="Images/question.png"  Stretch="None"  Visibility="Collapsed" />
                                    <TextBlock Grid.Column="1"  x:Name="MessageTextElement" Text="Hello World" HorizontalAlignment="Center"  TextWrapping="Wrap"  FontSize="15" Margin="10"></TextBlock>
                                </Grid>
                                <StackPanel x:Name="ButtonHolderElement"  Margin="10" VerticalAlignment="Bottom" HorizontalAlignment="Center"  Orientation="Horizontal">
                                    <Button x:Name="OkButtonElement" Content="OK" Style="{StaticResource MessageWindowButton}"  />
                                    <Button x:Name="CancelButtonElement" Content="Cancel" Style="{StaticResource MessageWindowButton}" />
                                    <Button x:Name="YesButtonElement" Content="Yes" Style="{StaticResource MessageWindowButton}"  />
                                    <Button x:Name="NoButtonElement" Content="No" Style="{StaticResource MessageWindowButton}"  />
                                    <Button x:Name="AbortButtonElement" Content="Abort" Style="{StaticResource MessageWindowButton}"  />
                                    <Button x:Name="RetryButtonElement" Content="Retry" Style="{StaticResource MessageWindowButton}"  />
                                    <Button x:Name="IgnoreButtonElement" Content="Ignore" Style="{StaticResource MessageWindowButton}"  />
                                </StackPanel>
                            </StackPanel>
                        </src:WindowPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="srcv:ErrorProvider">
        <Setter Property="Background" Value="#FFFF0000"/>
        <Setter Property="Foreground" Value="#FFFFFFFF"/>
        <Setter Property="FontSize" Value="12"/>
        <Setter Property="FontWeight" Value="Bold"/>
        <Setter Property="FontFamily" Value="Portable User Interface"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="srcv:ErrorProvider">

                    <Grid x:Name="RootElement" Opacity="1" Background="{x:Null}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Showing" />
                                <vsm:VisualState x:Name="MouseOver"/>
                                <vsm:VisualState x:Name="Closing"/>
                                <vsm:VisualState x:Name="Normal">
                                    <Storyboard AutoReverse="True" RepeatBehavior="Forever">
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootElement" Storyboard.TargetProperty="Opacity">
                                            <SplineDoubleKeyFrame KeyTime="00:00:0.3" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>

                                        <!--<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Width">
                                            <SplineDoubleKeyFrame KeyTime="00:00:0.3" Value="100"/>
                                        </DoubleAnimationUsingKeyFrames>-->

                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>


                        <Border x:Name="BorderElement" VerticalAlignment="Center" HorizontalAlignment="Center" Background="{TemplateBinding Background}" CornerRadius="25,25,25,25" Width="15" Height="15">
                            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="{TemplateBinding FontSize}" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" FontFamily="{TemplateBinding FontFamily}"><Run Text="!"/></TextBlock>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="inp:WatermarkedTextBox">
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Background" Value="#FFFFFFFF" />
        <Setter Property="Foreground" Value="#FF000000" />
        <Setter Property="Padding" Value="2" />
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFA3AEB9" Offset="0"/>
                    <GradientStop Color="#FF8399A9" Offset="0.375"/>
                    <GradientStop Color="#FF718597" Offset="0.375"/>
                    <GradientStop Color="#FF617584" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="inp:WatermarkedTextBox">
                    <Grid x:Name="Root" >
                        <Grid.Resources>
                            <SolidColorBrush x:Key="Background" Color="#FF003255"/>
                            <SolidColorBrush x:Key="BorderBrush" Color="#FF000000"/>
                            <SolidColorBrush x:Key="AccentBrush" Color="#FFFFFFFF"/>
                            <SolidColorBrush x:Key="DisabledBrush" Color="#A5FFFFFF"/>
                            <SolidColorBrush x:Key="WatermarkBrush" Color="#FFAAAAAA"/>
                            <LinearGradientBrush x:Key="FocusedStrokeBrush" StartPoint="0.5,0" EndPoint="0.5,1">
                                <GradientStop Color="#B2FFFFFF" Offset="0"/>
                                <GradientStop Color="#51FFFFFF" Offset="1"/>
                                <GradientStop Color="#66FFFFFF" Offset="0.325"/>
                                <GradientStop Color="#1EFFFFFF" Offset="0.325"/>
                            </LinearGradientBrush>
                        </Grid.Resources>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition GeneratedDuration="0" />
                                </vsm:VisualStateGroup.Transitions>
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" To="#FF99C1E2" Duration="0"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity" To="0.5" Duration="0" />
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="WatermarkStates">
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition GeneratedDuration="0" />
                                </vsm:VisualStateGroup.Transitions>
                                <vsm:VisualState x:Name="Unwatermarked" />
                                <vsm:VisualState x:Name="Watermarked">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Opacity" To="0" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="Watermark" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition GeneratedDuration="0" />
                                    <vsm:VisualTransition To="Focused" GeneratedDuration="0:0:0.1" />
                                </vsm:VisualStateGroup.Transitions>
                                <vsm:VisualState x:Name="Unfocused" />
                                <vsm:VisualState x:Name="Focused">
                                    <Storyboard>
                                        <!--<DoubleAnimation Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />-->
                                        <DoubleAnimation Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="Watermark" Storyboard.TargetProperty="Opacity" To="0" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Border x:Name="Border" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1" Opacity="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
                            <Grid>
                                <Border x:Name="ReadOnlyVisualElement" Background="#72F7F7F7" Opacity="0" />
                                <Border x:Name="MouseOverBorder" BorderThickness="1" BorderBrush="Transparent">
                                    <ScrollViewer x:Name="ContentElement" Padding="{TemplateBinding Padding}" BorderThickness="0" IsTabStop="False"/>
                                </Border>
                                <ContentControl
                  x:Name="Watermark"
                  Opacity="0"
                  IsTabStop="False"
                  IsHitTestVisible="False"
                  Content="{TemplateBinding Watermark}"
                  Foreground="{StaticResource WatermarkBrush}"
                  Background="{TemplateBinding Background}"
                  FontFamily="{TemplateBinding FontFamily}"
                  FontSize="{TemplateBinding FontSize}"
                  FontStretch="{TemplateBinding FontStretch}"
                  FontStyle="{TemplateBinding FontStyle}"
                  FontWeight="{TemplateBinding FontWeight}"
                  Padding="{TemplateBinding Padding}"
                  Margin="0,-2,0,0"/>
                            </Grid>
                        </Border>
                        <Border x:Name="DisabledVisualElement" Background="#A5F7F7F7" BorderBrush="#A5F7F7F7" BorderThickness="{TemplateBinding BorderThickness}" Opacity="0" IsHitTestVisible="False"/>
                        <Border x:Name="FocusVisualElement" BorderBrush="#FF6DBDD1" BorderThickness="{TemplateBinding BorderThickness}" Margin="1" Opacity="0" IsHitTestVisible="False"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
